package com.itheima.service.impl;

import com.itheima.mapper.DashBoardMapper;
import com.itheima.pojo.vo.ArticleDTO;
import com.itheima.pojo.vo.CategoryArticleCountDTO;
import com.itheima.pojo.vo.CommentDTO;
import com.itheima.pojo.vo.MonthlyArticleCountDTO;
import com.itheima.service.DashBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Insight
 * @Description: TODO
 * @Date: 2024-06-11 20:13
 * @Version: 1.0
 */
@Service
public class DashBoardServiceImpl implements DashBoardService {
    @Autowired
    private DashBoardMapper dashBoardMapper;
    @Override
    public Integer countNewsTotal() {
        return dashBoardMapper.countNewsTotal();
    }

    @Override
    public Integer countUsersTotal() {
        return dashBoardMapper.countUsersTotal();
    }

    @Override
    public Integer countCommentsTotal() {
        return dashBoardMapper.countCommentsTotal();
    }

    @Override
    public Integer countDaliyCommentsTotal() {
        return dashBoardMapper.countDaliyCommentsTotal();
    }

    @Override
    public List<MonthlyArticleCountDTO> getMonthlyArticleCounts() {
        return dashBoardMapper.getMonthlyArticleCounts();
    }

    @Override
    public List<CategoryArticleCountDTO> getrateArticles() {
        return dashBoardMapper.getrateArticles();
    }

    @Override
    public List<ArticleDTO> getLatestArticles() {
        return dashBoardMapper.getLatestArticles();
    }

    @Override
    public List<CommentDTO> getLatestComments() {
        return dashBoardMapper.getLatestComments();
    }
}
